import { request, config } from 'utils';
import { stringify } from 'qs';
const {
  api: {
    recursivemgt: {
      transpond: {
        apigetalldevices,
        apigetportbyde
      }
    },
    datacenter: { apigetcurrentcachehit, apigetallcachehit,apigreshcachehit },
  },
} = config;

export function getCurrentCache(params) {
  return request(`${apigetcurrentcachehit}?${stringify(params)}`);
}

export function getAllCache(params) {
  return request(`${apigetallcachehit}?${stringify(params)}`);
}
export function getAllDevices(params) {
  return request(`${apigetalldevices}?${stringify(params)}`);
}

export function getPort(params) {
  return request(`${apigetportbyde}?${stringify(params)}`);
}

export function freshCacheHit(params) {
  return request(apigreshcachehit,{
    method: "POST",
    body: {
      ...params
    }
  })
}


